# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

platform :ios do
  desc "Build the iOS package"
  lane :release do
    increment_build_number(xcodeproj: './ios/trident.xcodeproj')
    build_app(workspace: "./ios/trident.xcworkspace", scheme: "Build", export_xcargs: "-allowProvisioningUpdates")
  end

  desc "Push a new beta build to TestFlight"
  lane :beta do
    release
    upload_to_testflight(
      skip_waiting_for_build_processing: true
    )
  end
end

platform :android do
  desc 'Build the Android application.'
  lane :release do
    gradle(task: 'clean', project_dir: 'android/')
    gradle(
      task: 'assemble', 
      build_type: 'Release', 
      project_dir: 'android/',
      properties: {
        "android.injected.signing.store.file" => "keystores/demo-release-keystore",
        "android.injected.signing.store.password" => "12345678",
        "android.injected.signing.key.alias" => "android.keystore",
        "android.injected.signing.key.password" => "12345678",
      }
    )
    puts "\nAPK path is: #{Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]}"
  end
end
